package com.zy.composeworld.ktx

import android.app.Service
import android.content.Context
import android.graphics.drawable.Drawable
import android.os.Build
import android.os.VibrationEffect
import android.os.Vibrator
import android.os.VibratorManager
import android.widget.Toast
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment

fun Context.toast(msg: String) = Toast.makeText(this, msg, Toast.LENGTH_SHORT).show()

fun Fragment.toast(msg: String) = requireActivity().toast(msg)


fun Context.color(res: Int): Int = ContextCompat.getColor(this, res)


fun Context.drawable(res: Int): Drawable? = ContextCompat.getDrawable(this, res)

fun Context.dimen(res: Int): Int = resources.getDimensionPixelSize(res)

